<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //最大公约数和最小公倍数
    function commonDivisor(max, min) {
        var num;
        if (max < min) {
            num = max;
            max = min;
            min = num;
        }
        var x = max % min;
        if (x == 0) {
            return min;
        }
        return commonDivisor(min, x);
    }
    var m = prompt("请输入第一个数：");
    var n = prompt("请输入第二个数：");
    var result = commonDivisor(m, n);
    var y = m * n / result;
    console.log(m + "和" + n + "的最大公约数为：" + result);
    console.log(m + "和" + n + "的最小公倍数为：" + y);

    //斐波拉契数列
    function fn(n) {
        if (n <= 2) {
            return 1;
        }
        return fn(n - 1) + fn(n - 2);
    }
    var m = fn(12);
    console.log(m);
</script>

</html>